﻿package tk.mystudio.permission.dao.impl;

import org.eclipse.persistence.queries.QueryByExamplePolicy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import tk.mystudio.dao.impl.BaseDaoImpl;
import tk.mystudio.permission.bean.Resource;
import tk.mystudio.permission.dao.ResourceDao;
import tk.mystudio.util.Order;
import tk.mystudio.util.Page;

@Repository
public class ResourceDaoImpl extends BaseDaoImpl<Resource> implements
		ResourceDao {
	
	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Override
	public Page<Resource> listByPage(Object example, Page<Resource> page,
			Order[] orders) {
		QueryByExamplePolicy policy = getBasicQBEPolicy();
		policy.addSpecialOperation(String.class, "likeIgnoreCase");
		return executePageQuery(example, policy, null, page, orders);
	}


}
